<template>
  <div class="baseData-Print" style="width: 100%;height: 100%;background-color: #FFFFFF;">
    <div class="col-md-12">
      <section class="panel">
        <div class="panel-body">
          <div class="row" style="padding: 0 15px;text-align: center;overflow: hidden;position:relative;">
            <h4 v-text="pageDatatableTitle"></h4>
          </div>
          <table style="border-collapse: collapse;border: 1px solid #000;width: 100%;">
            <thead>
              <tr>
                <td style="width: 48%; border: 1px solid #000;width: 16%;text-align: center;padding: 10px 0;"
                  colspan="2">名称</td>
                <td style="width: 12%; border: 1px solid #000;width: 16%;text-align: center;padding: 10px 0;"
                  @click="ArrSort(this.app.ArrSort_flag)">学校自评(100分制) </td>
                <td style="width: 12%; border: 1px solid #000;width: 16%;text-align: center;padding: 10px 0;">实际得分</td>
                <td style="width: 12%; border: 1px solid #000;width: 16%;text-align: center;padding: 10px 0;">市局初审</td>
                <td style="width: 12%; border: 1px solid #000;width: 16%;text-align: center;padding: 10px 0;">省局复核</td>
              </tr>
            </thead>
            <tbody v-show="this.a1&&this.a1.length ==0 ?false : true" style="display: none">
              <tr v-for="(item,index) in a1">
                <td style="border: 1px solid #000;width: 16%;text-align: center;padding: 10px 0;"> {{item.titleName}}
                </td>
                <td style="border: 1px solid #000;width: 16%;text-align: center;padding: 10px 0;"> {{item.subtitleName}}
                </td>
                <td style="border: 1px solid #000;width: 16%;text-align: center;padding: 10px 0;"
                  :readonly="item.titleName == '总分'? 'false' : a1Num[index] = a1[index]" hidden="hidden"></td>
                <td style="border: 1px solid #000;width: 16%;text-align: center;padding: 10px 0;">
                  {{item.selfAssessScore}}
                </td>
                <td style="border: 1px solid #000;width: 16%;text-align: center;padding: 10px 0;">
                  {{ parseFloat(item.selfAssessScore * item.titleWeight * item.subTitleWeight).toFixed(2)  }}
                </td>
                <td style="border: 1px solid #000;width: 16%;text-align: center;padding: 10px 0;">
                  {{item.reAssessScore}}
                </td>
                <td style="border: 1px solid #000;width: 16%;text-align: center;padding: 10px 0;">
                  {{item.finalAssessScore}}
                </td>
              </tr>
            </tbody>
          </table>
          <div style="height: 10px"></div>
          <div class="memoContainer">
            <div v-for="(item,index) in getTextMemo">
              <div v-if="item.selfAssessMemo" class="memoDiv">
                <span>学校备注</span> - <span>{{item.titleName}}</span> - <span>{{item.subtitleName}}</span> :
                <span>{{item.selfAssessMemo}}</span>
              </div>
              <!-- <div v-if="item.reAssessMemo" class="memoDiv">
                <span>市局备注</span> - <span>{{item.titleName}}</span> - <span>{{item.subtitleName}}</span> :
                <span>{{item.reAssessMemo}}</span>
              </div> -->
              <div v-if="item.finalAssessMemo" class="memoDiv">
                <span>省局备注</span> - <span>{{item.titleName}}</span> - <span>{{item.subtitleName}}</span> :
                <span>{{item.finalAssessMemo}}</span>
              </div>
            </div>
          </div>
        </div>
      </section>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        a1: [], //获取的title、value
        ArrSort_flag: false, //标志
        ArrHaveCulture: [], //有教育教学的
        ArrNoCulture: [], //无教育教学
        //  a1Num :[], //所有数值  ---计算总分
        pageDatatableTitle: "办训办学评估表", //表格有无文化成绩标识
      }
    },
    methods: {

    },
    created() {
      this.a1 = JSON.parse(window.sessionStorage.getItem("ArrKey"))
    },
    computed: {
      a1Num: function() {
        return this.a1.filter(function(obj) {
          return obj.titleName !== '总分'
        })
      },
      getNumSum: {
        get: function() {
          let getNumSum = 0;
          //cache:false

          for (let i = 0; i < this.a1Num.length; i++) {
            getNumSum += (this.a1Num[i].selfAssessScore * this.a1Num[i].titleWeight * this.a1Num[i].subTitleWeight)
          }
          return getNumSum;

        }

      },
      getTextMemo: function() {
        this.a1.filter(function(obj) {})

        return this.a1
      }

    },
  }
</script>

<style lang="scss" scoped>
  .baseData-Print {
    width: 100%;
    height: 100%;
    background-color: #FFFFFF;
  }

  .table>tbody>tr>td {
    border: none;
    font-family: '宋体';
    font-size: 16px;
  }

  .second-level-title {
    font-size: 16px;
    font-family: '宋体';
  }


  p {
    text-indent: 2em;
    font-size: 16px;
    font-family: '宋体';
  }

  table {
    width: 100%;
  }

  table {
    border-collapse: collapse;
    border: 1px solid #000;
  }

  table thead>tr>td {
    border: 1px solid #000;
    width: 16%;
    text-align: center;
    padding: 10px 0;
  }

  p {
    margin: 0;
    padding: 0;
  }

  table tbody>tr>td {
    border: 1px solid #000;
    vertical-align: middle;
    text-align: center;
    /*font-family: "宋体";
        font-size: 16px;
        text-align: center;*/
    padding: 8px 0;
  }

  .table .tfoot>tr>td {
    border: 1px solid #000;
  }

  .memoContainer {
    width: 100%;
    border: 1px solid #000;
  }

  .memoDiv {
    padding: 5px 0;
    margin-left: 10px;
  }
</style>
